Skip to content

Conversation

royeden
Copy link
Contributor

@royeden royeden commented Aug 24, 2021

See issue #4251

Fixes compiled whitespace in static class attributes being preserved:

This repro compiles the following

<div class="
  asdf  
">Hello World!</div>

into

_createElementBlock("div", { class: "\n  asdf  \n" }, "Hello World!")

preserving whitespace after parsing.

This PR fixes that and normalizes whitespace in the DOM in case it's added via :class or :style binding.

Close #4251

@yyx990803
Copy link
Member

After taking another look, I believe the runtime changes are not necessary when the compiler already outputs condensed class names, so I refactored to remove unnecessary abstractions.

@yyx990803 yyx990803 merged commit b8653d3 into vuejs:master Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler: condense known attributes whitespace
2 participants